﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Web.Script.Serialization;
using System.Xml.Serialization;

namespace viBook.Models
{
    public class Category
    {
        public int Id { set; get; }
        [Required(ErrorMessage = "CategoryName is required.")]
        [StringLength(20, ErrorMessage = "CategoryName cannot be longer than 20 characters")]
        public string CategoryName { set; get; }

        public List<Book> ListBook { set; get; }

        [NotMapped]
        public int NumberOfBook { set; get; }
    }
}